#!/bin/sh

#获取有线网卡名称，如 eth0, enp1s0
eth_name=`cat /proc/net/dev |awk -F ':' '/^e/{print $1}'`

brctl showstp virbr0 > /dev/null 2>&1 || brctl addbr virbr0
ifconfig virbr0 up
ifconfig virbr0 192.168.100.1
brctl addif virbr0 $1
ifconfig $1 up

brctl addif virbr0 $eth_name
